package code.rocky.chapter02;

import java.util.Random;
// 建议30：不要随便设置随机种子
public class Suggest30 {
    public static void main(String[] args) {
        demo01();
        demo02();
    }

    private static void demo01() {
        Random r = new Random();
        for (int i = 0; i < 4; i++) {
            System.out.println("第 " + i + " 次: " + r.nextInt());
        }
    }

    private static void demo02() {
        System.out.println("======demo02=======");
        Random r = new Random(1000);
        for (int i = 0; i < 10; i++) {
            System.out.println("第 " + i + " 次: " + r.nextInt());
        }
    }
}
